import Vue from "vue";

import "normalize.css"; // A modern alternative to CSS resets

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
// import locale from "element-ui/lib/locale/lang/en"; // lang i18n

import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";

//自定义指令
import "common/js/directive";
// import "@/icons"; // icon

//增加水印
import Cookies from "js-cookie";
const username = Cookies.get("_sso_username_2100822");
waterMark({
  textStyle: "rgba(0,0,0,0.04)",
  systemId: "2100822",
  fontSize: "14px",
  userId: username,
  imgWidthDis: 10,
  imgHeightDis: 10,
  projectName: "audit-" + username,
  containerEl: document.querySelector(".con"),
});

//时间格式化模块
import StaticDate from "./common/js/staticDate";
Vue.prototype.staticDate = new StaticDate();
//加载loading
import { openLoading } from "./common/js/loading.js";
Vue.prototype.openLoading = openLoading;

//提示信息
import DonMessage from "./common/js/message.js";
Vue.prototype.message = new DonMessage(); //消息提示

//全局通用的工具函数
import * as utils from "@/utils/index";
Vue.prototype.utils = utils;
import { getCodeSession } from "@/utils/index";
Vue.prototype.utils.admin = getCodeSession;

//公共的方法
import * as $common from "@/common/js/common";
Vue.prototype.$common = $common;

//全局的文字配置
import { config } from "./textConfig";
Vue.prototype.config = config;

// 全局注入自己封装的组件
import globalComp from "components";
Vue.use(globalComp);

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale });
Vue.use(ElementUI, { size: "small" });
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

import VueCookies from "vue-cookies";
Vue.use(VueCookies);

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  render: (h) => h(App),
});
